﻿/**
 * 
 */
var bEatmsg = false;
var msgMButton;
var msgMLocx;
var msgMLocy;
var AcceptSprite;

//地图上的鼠标事件
function setupMouseEvent_map(objid){
	
	if (!objid) return;
	
	document.getElementById(objid).onmouseup =function(e){ 
		if (bEatmsg || OnSnario || onFight) return;
		var sx = document.getElementById(objid).offsetLeft;
		var sy = document.getElementById(objid).offsetTop;
		
		msgMLocx = e.clientX - sx; 
		msgMLocy = e.clientY - sy; 
		msgMButton = 1;
		
		var ox =Math.floor((msgMLocx-screenx)/(WALKSTEPD*WALKSTEPCNT));
		var oy =Math.floor((msgMLocy-screeny)/(WALKSTEPD*WALKSTEPCNT));
		
		AcceptSprite.go(ox,oy);
		
	}
	
	document.getElementById(objid).onmousemove =function(e){
		/*
		var sx = document.getElementById(objid).offsetLeft;
		var sy = document.getElementById(objid).offsetTop;
		msgMLocx = e.clientX - sx; 
		msgMLocy = e.clientY - sy; 
		msgMButton = 1;*/
	}
		
}
